<% @valleyer.albums.each do |album| %>
  <div class="<%= album.new? ? 'monomer_new':'monomer_old' %>">
    <div class="picture">
      <% if album.photos.length == 0 %>
        <%= image_tag 'valleyer/nil_album.jpg' %>
      <% else %>
        <%= photo_image_tag album.new_photo_of_the_album, :height => 105 %>
      <% end %>
    </div>
    <div class="operate">
      <div class="summarize">
        <div class="name">
          <%= link_to_remote truncate(album.name, :length => 5),
            :update => :album_replace,
            :url => valleyers_show_albums_show_photos_show_entries_url(
            :album_id => album.id,
            :valleyer_id => @valleyer.id
          ),
            :method => :get,
            :html => {
            :id => "show_album_#{album.id}",
            :title => album.name
          }
        %>
          <b>(<%= album.photos.length %>)</b>
        </div>
        <p class="message"><%= album.created_at.strftime("%Y年%m月%d日") %>更新</p>
        <p class="message">
          浏览(<%= album.browse_records_count %>)
          评论(<%= album.posts_count %>)
        </p>
      </div>
      <div class="maintain">
        <% if loggined_by? album.author %>
          <%= link_to_remote image_tag("valleyer/edit_album.jpg"),
            :update => "createBase",
            :url => edit_valleyers_show_album_url(album),
            :method => :get,
            :html => {
            :id => "edit_album_#{album.id}"
          },
            :complete => "createShow();"
        %>
          <%= link_to_remote image_tag("valleyer/delete_album.jpg"),
            :update => "subject",
            :url => valleyers_show_album_url(album),
            :method => :delete,
            :html => {
            :class => "delete_album"
          }
        %>
        <% end %>
      </div>
    </div>
  </div>
<% end %>
